#include "debug.h"
#include "Elements\\AElement.h"

using namespace SDL::UTILS;

NS_BEGIN(SDL)
NS_BEGIN(ELEMENTS)

#pragma region CTOR & DTOR

AElement::AElement()
	: m_surface(NULL), m_position(), m_hidden(false), m_disabled(false)
{
	CTOR("AElement", this);
}

AElement::AElement(AElement const& _aelement)
{
	CTOR("AElement", this);
	*this = _aelement;
}

AElement::~AElement()
{
	DTOR("AElement", this);
	if (m_surface != NULL)
		delete m_surface;
}

#pragma endregion
#pragma region Operators

AElement& AElement::operator=(AElement const& _aelement)
{
	if (this != &_aelement)
	{
		*m_surface = *_aelement.m_surface;
		m_position = _aelement.m_position;
		m_hidden = _aelement.m_hidden;
		m_disabled = _aelement.m_disabled;
	}
	return (*this);
}

bool AElement::operator==(AElement const& _aelement) const
{
	return (*m_surface == *_aelement.GetSurface() &&
			m_position == _aelement.GetPosition());
}

bool AElement::operator!=(AElement const& _aelement) const
{
	return (*m_surface != *_aelement.GetSurface() ||
			m_position != _aelement.GetPosition());
}

#pragma endregion
#pragma region Getters & Setters

Surface* AElement::GetSurface() const
{
	return (m_surface);
}

void AElement::SetSurface(Surface* _surface)
{
	m_surface = _surface;
}

Rect const& AElement::GetPosition() const
{
	return (m_position);
}

bool AElement::GetHidden() const
{
	return (m_hidden);
}

void AElement::SetHidden(bool _value)
{
	m_hidden = _value;
}

bool AElement::GetDisabled() const
{
	return (m_disabled);
}

void AElement::SetDisabled(bool _value)
{
	m_disabled = _value;
}

#pragma endregion

NS_END(ELEMENTS)
NS_END(SDL)
